<?php
	include_once dirname(dirname(dirname(__FILE__))).'/inc/bootConfig.php';
	include_once '../checkLogin.php';
	$action = getRequest('act');
	$mid = getRequest('mid');
	if(!empty($action) && !empty($mid)){
		if($action == 'del'){
			Module_Edit::delete('zjx_msgboard','m_id='.$mid);	
		}
	}
	$allMsg = Module_Select::getAllMsgInfo();
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>查看模块</title>
<link rel="stylesheet" type='text/css' href='../Public/static/css/admincp/admincp.css'>
</head>
<body>
<div id="cpcontainer" class="container">
	<div class="floattop">
		<div class="itemtitle">
			<h3>客户留言内容管理</h3>
		</div>
	</div>
<div id="threadlist">
<div class="floattopempty"></div>
<form action='' method='post'>
<table class="tb tb2 nobdb">
	<tbody>
		<tr>
			<th class="partition" colspan="15">总计留言&nbsp;<?php echo count($allMsg)?>&nbsp;条</th>
		</tr>
		<tr class="header">
			<th></th>
			<th>留言内容</th>
			<th>留言人</th>
			<th>联系方式</th>
			<th>发表时间</th>
		</tr>
<?php 
	if(is_array($allMsg) && count($allMsg)>0){
		foreach ($allMsg as $v){
?>
		<tr class="hover">
			<td class="td25"><input type="radio" value="<?php echo $v['m_id']?>" name="content" class="checkbox"></td>
			<td><a title="<?php echo strip_tags($v['m_content'])?>" href="msgboard_info.php?id=<?php echo $v['m_id']?>"><?php echo msubstr(strip_tags($v['m_content']),0,40)?></a></td>
			<td><?php echo $v['m_name']?></td>
			<td>
				手机号：<?php echo $v['m_phone']?$v['m_phone']:'未留'?>
				<br>邮&nbsp;箱：<a href="mailto:<?php echo $v['m_email']?$v['m_email']:'未留'?>"><?php echo $v['m_email']?$v['m_email']:'未留'?></a>
			</td>
			<td><?php echo $v['m_time']?></td>
		</tr>
<?php 
		}
	}
?>
		<tr>
			<td colspan="7" class="td25">
				<input type='button' class="btn delete" value="删除" />
				<input type='button' class="btn edit" value="详情" />
			</td>
		</tr>
	</tbody>
</table>
</form>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="../Public/static/js/jquery.js"></script>
<script type="text/javascript">
$('input.delete').click(function(){
	if(!$('input:checked').val()){
		alert('请先选择需要删除的版块内容')
		return false;
	}
	if(confirm('确认删除吗?')){
		location.href="?act=del&mid="+$('input:checked').val();	
	}
})
$('input.edit').click(function(){
	if($('input:checked').val()){
		location.href="msgboard_info.php?id="+$('input:checked').val()
	}else{
		alert('请先选择需要操作的信息')
	}
})
</script>